home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Arsenal / OS2 Arsenal v1.0 (Disc 1)(Arsenal Computer).ISO / os2_inet / tcp20c4.exe / BPUBSC1.ZIP / DOC / rxsocket.inf (.txt) < prev   
OS/2 Help File  |  1994-04-12  |  39KB  |  1,485 lines

  1.  
  2. ΓòÉΓòÉΓòÉ 1. Introduction ΓòÉΓòÉΓòÉ
  3.  
  4. The REXX Socket Support package provides access to the OS/2 TCP/IP socket 
  5. API's.  It is assumed you are familiar with the basic socket APIs and that you 
  6. can reference the OS/2 specific ones. 
  7.  
  8. References 
  9.  
  10. For information on socket calls, refer to the IBM Transmission Control 
  11. Protocol/Internet Protocol Version 2.0 for OS/2:  Programmer's Reference. 
  12.  
  13. A widely available book with information on the basic socket APIs is 
  14. Internetworking with TCP/IP Volume I:  Principals, Protocols, and Architecture 
  15. by Douglas Comer. 
  16.  
  17. Requirements 
  18.  
  19. The REXX Socket Support package requires the OS/2 TCP/IP product, version 2.0 
  20. or higher. 
  21.  
  22. The REXX feature from the OS/2 Setup and Installation window must be installed. 
  23. To access the REXX feature, choose Selective Install from the OS/2 System Setup 
  24. folder.  Then from the System Configuration window, select OK to display the 
  25. OS/2 Setup and Installation window. Check the REXX feature and select the 
  26. Install push button. 
  27.  
  28.  
  29. ΓòÉΓòÉΓòÉ 2. Installation ΓòÉΓòÉΓòÉ
  30.  
  31. The REXX Socket Support package is contained in the file rxsock.dll.  This 
  32. dynamic link library (DLL) needs to be placed in a directory listed in your 
  33. LIBPATH statement in your CONFIG.SYS file.  To get access to the functions in 
  34. the REXX Socket Support package, execute the following REXX code: 
  35.  
  36. rc = RxFuncAdd("SockLoadFuncs","rxSock","SockLoadFuncs")
  37. rc = SockLoadFuncs()
  38.  
  39. To unload the DLL, you should first call the SockDropFuncs() function, then 
  40. exit all CMD.EXE shells.  After exiting all the command shells, the DLL will be 
  41. dropped by OS/2 and can be deleted or replaced. 
  42.  
  43.  
  44. ΓòÉΓòÉΓòÉ 3. Parameters, Return Values, and Parameters Set ΓòÉΓòÉΓòÉ
  45.  
  46. Select an item: 
  47.  
  48. Parameters
  49.  socket
  50.  domain
  51.  address
  52.  dotAddress
  53.  host
  54.  
  55. Return Values
  56.  
  57. Variables Set
  58.  errno
  59.  h_errno
  60.  
  61.  
  62. ΓòÉΓòÉΓòÉ <hidden> Return Values ΓòÉΓòÉΓòÉ
  63.  
  64. Return values for most functions are the same as the C equivalents, unless 
  65. otherwise noted. 
  66.  
  67.  
  68. ΓòÉΓòÉΓòÉ <hidden> socket Parameter ΓòÉΓòÉΓòÉ
  69.  
  70. The socket parameter is the socket value.  It is an integer number that is 
  71. returned from SockSocket(). 
  72.  
  73.  
  74. ΓòÉΓòÉΓòÉ <hidden> domain Parameter ΓòÉΓòÉΓòÉ
  75.  
  76. The domain parameter is the domain value.  The only supported domain is 
  77. "AF_INET". 
  78.  
  79.  
  80. ΓòÉΓòÉΓòÉ <hidden> address Parameter ΓòÉΓòÉΓòÉ
  81.  
  82. The address parameter is the 'stem' of a stemmed variable with the following 
  83. values: 
  84.  
  85. address.family 
  86.    always set this to "AF_INET" 
  87.  
  88. address.port 
  89.    a port number 
  90.  
  91. address.addr 
  92.    a dotted decimal address, or where appropriate, INADDR_ANY 
  93.  
  94. When the address parameter is needed, you should set it to the name of a stem 
  95. variable for the function to set (or that the function will read from).  For 
  96. example, if you passed the string "xxx.!" as a parameter, the following 
  97. variables will be set by the function, or queried by the function: 
  98.  
  99. "xxx.!family"
  100. "xxx.!port"
  101. "xxx.!addr"
  102.  
  103. Related Topic 
  104.  
  105. Notes on stemmed variables
  106.  
  107.  
  108. ΓòÉΓòÉΓòÉ <hidden> dotAddress Parameter ΓòÉΓòÉΓòÉ
  109.  
  110. The dotAddress is the standard dotted decimal address.  For example, the 
  111. following string is a valid address: 
  112.  
  113. "9.23.19.63"
  114.  
  115.  
  116. ΓòÉΓòÉΓòÉ <hidden> host Parameter ΓòÉΓòÉΓòÉ
  117.  
  118. The host parameter is the 'stem' of a stemmed variable with the following 
  119. values: 
  120.  
  121. host.name 
  122.    the standard name of the host 
  123.  
  124. host.alias.0 
  125.    the number of aliases for this host 
  126.  
  127. host.alias.1 
  128.    the first alias for this host 
  129.  
  130. host.alias.n 
  131.    the n'th alias for this host 
  132.  
  133. host.addrtype 
  134.    always set this to "AF_INET" 
  135.  
  136. host.addr 
  137.    a dotted decimal address (default address) 
  138.  
  139. host.addr.0 
  140.    the number of addresses for this host 
  141.  
  142. host.addr.1 
  143.    the first address for this host 
  144.  
  145. host.addr.n 
  146.    the n'th address for this host 
  147.  
  148. When the host parameter is needed, you should set it to the name of a stem 
  149. variable for the function to set (or that the function will read from).  For 
  150. example, if you passed the string "xxx.!" as a parameter, the following 
  151. variables will be set by the function, or queried by the function: 
  152.  
  153. "xxx.!name"
  154. "xxx.!alias.0", "xxx.!alias.1" ... "xxx.!alias.n"
  155. "xxx.!addrtype"
  156. "xxx.!addr"
  157. "xxx.!addr.0", "xxx.!addr.1" ... "xxx.!addr.n"
  158.  
  159. Related Topic 
  160.  
  161. Notes on stemmed variables
  162.  
  163.  
  164. ΓòÉΓòÉΓòÉ <hidden> Notes on Stemmed Variables ΓòÉΓòÉΓòÉ
  165.  
  166. The address parameter and host parameters are stemmed variable names.  The 
  167. SockSelect() call also has stemmed variables. 
  168.  
  169. Traditionally, you would pass a string like "addr." as a parameter, and expect 
  170. to have the variables addr.family, addr.port, and addr.addr set by the 
  171. function.  In the examples given in this document, stems like "addr.!" are 
  172. used.  The exclamation point helps to distinguish the tail values, so they will 
  173. not be used as normal variables. 
  174.  
  175. For example, with the following code you might expect the say statement to 
  176. write the port number of the accepted socket.  Instead it writes the value of 
  177. the variable addr.923, since the port variable is set to a value. 
  178.  
  179. port = 923
  180. sNew = SockAccept(sOld,"addr.")
  181. say addr.port
  182.  
  183. Since you normally do not use an exclamation point in your variables, it's 
  184. unlikely that you will be using the variable "!port" in your program. 
  185.  
  186. Also note, some programmers prefer other characters, including "_", "0", and 
  187. "1".  The digits are allowed to prefix tail values and are very secure against 
  188. this kind of accidental misuse. However, the digit characters are hard to 
  189. distinguish from O, I, and l. 
  190.  
  191.  
  192. ΓòÉΓòÉΓòÉ <hidden> errno Variable ΓòÉΓòÉΓòÉ
  193.  
  194. The errno variable is set after every REXX Socket Support (rxSock) function 
  195. call.  The value of 0 indicates no error occurred. 
  196.  
  197. The value is set even if the C API that the REXX function callc does not set 
  198. the variable.  In that case, the value has no meaning. 
  199.  
  200. The errno variable will have one of the following values (or a numeric value if 
  201. the number is not one of these values): 
  202.  
  203.       "EWOULDBLOCK"
  204.       "EINPROGRESS"
  205.       "EALREADY"
  206.       "ENOTSOCK"
  207.       "EDESTADDRREQ"
  208.       "EMSGSIZE"
  209.       "EPROTOTYPE"
  210.       "ENOPROTOOPT"
  211.       "EPROTONOSUPPORT"
  212.       "ESOCKTNOSUPPORT"
  213.       "EOPNOTSUPP"
  214.       "EPFNOSUPPORT"
  215.       "EAFNOSUPPORT"
  216.       "EADDRINUSE"
  217.       "EADDRNOTAVAIL"
  218.       "ENETDOWN"
  219.       "ENETUNREACH"
  220.       "ENETRESET"
  221.       "ECONNABORTED"
  222.       "ECONNRESET"
  223.       "ENOBUFS"
  224.       "EISCONN"
  225.       "ENOTCONN"
  226.       "ESHUTDOWN"
  227.       "ETOOMANYREFS"
  228.       "ETIMEDOUT"
  229.       "ECONNREFUSED"
  230.       "ELOOP"
  231.       "ENAMETOOLONG"
  232.       "EHOSTDOWN"
  233.       "EHOSTUNREACH"
  234.       "ENOTEMPTY"
  235.  
  236.  
  237. ΓòÉΓòÉΓòÉ <hidden> h_errno Variable ΓòÉΓòÉΓòÉ
  238.  
  239. The h_errno variable is set after every REXX Socket Support (rxSock) function 
  240. call.  The value of 0 indicates no error occurred. 
  241.  
  242. The value is set even if the C API that the REXX function calls does not set 
  243. the variable.  In that case, the value has no meaning. 
  244.  
  245. The h_errno variable will have one of the following values (or a numeric value 
  246. if the number is not one of these values): 
  247.  
  248.       "HOST_NOT_FOUND"
  249.       "TRY_AGAIN"
  250.       "NO_RECOVERY"
  251.       "NO_ADDRESS"
  252.  
  253.  
  254. ΓòÉΓòÉΓòÉ 4. Functions ΓòÉΓòÉΓòÉ
  255.  
  256. Most of the functions correspond to their like-named C functions available in 
  257. the OS/2 TCP/IP socket library. 
  258.  
  259. Initialization Functions 
  260.  
  261. SockLoadFuncs()      SockDropFuncs()      SockVersion()
  262. SockInit()
  263.  
  264. Socket Connections Functions 
  265.  
  266. SockAccept()         SockBind()           SockConnect()
  267. SockClose()          SockSoClose()        SockListen()
  268. SockShutDown()       SockSocket()
  269.  
  270. Address and Name Functions 
  271.  
  272. SockGetHostByAddr()  SockGetHostByName()  SockGetHostID()
  273. SockGetPeerName()    SockGetSockName()
  274.  
  275. Sending and Receiving Functions 
  276.  
  277. SockRecv()           SockRecvFrom()       SockSelect()
  278. SockSend()           SockSendTo()
  279.  
  280. Socket Options Functions 
  281.  
  282. SockSetSockOpt()     SockGetSockOpt()
  283.  
  284. Error Functions 
  285.  
  286. SockPSock_Errno()    SockSock_Errno()
  287.  
  288. Commands Function 
  289.  
  290. SockIoctl()
  291.  
  292.  
  293. ΓòÉΓòÉΓòÉ <hidden> Initialization ΓòÉΓòÉΓòÉ
  294.  
  295.  SockLoadFuncs() 
  296.  SockDropFuncs() 
  297.  SockVersion() 
  298.  SockInit() 
  299.  Calls by Task 
  300.  
  301.  
  302. ΓòÉΓòÉΓòÉ <hidden> Connections ΓòÉΓòÉΓòÉ
  303.  
  304.  SockAccept() 
  305.  SockBind() 
  306.  SockConnect() 
  307.  SockClose() 
  308.  SockSoClose() 
  309.  SockListen() 
  310.  SockShutDown() 
  311.  SockSocket() 
  312.  Calls by Task 
  313.  
  314.  
  315. ΓòÉΓòÉΓòÉ <hidden> Address/Name ΓòÉΓòÉΓòÉ
  316.  
  317.  SockGetHostByAddr() 
  318.  SockGetHostByName() 
  319.  SockGetHostID() 
  320.  SockGetPeerName() 
  321.  SockGetSockName() 
  322.  Calls by Task 
  323.  
  324.  
  325. ΓòÉΓòÉΓòÉ <hidden> Send/Receive ΓòÉΓòÉΓòÉ
  326.  
  327.  SockRecv() 
  328.  SockRecvFrom() 
  329.  SockSelect() 
  330.  SockSend() 
  331.  SockSendTo() 
  332.  Calls by Task 
  333.  
  334.  
  335. ΓòÉΓòÉΓòÉ <hidden> Options ΓòÉΓòÉΓòÉ
  336.  
  337.  SockSetSockOpt() 
  338.  SockGetSockOpt() 
  339.  Calls by Task 
  340.  
  341.  
  342. ΓòÉΓòÉΓòÉ <hidden> Errors ΓòÉΓòÉΓòÉ
  343.  
  344.  SockPSock_Errno() 
  345.  SockSock_Errno() 
  346.  Calls by Task 
  347.  
  348.  
  349. ΓòÉΓòÉΓòÉ <hidden> Commands ΓòÉΓòÉΓòÉ
  350.  
  351.  SockIoctl() 
  352.  Calls by Task 
  353.  
  354.  
  355. ΓòÉΓòÉΓòÉ 4.1. SockAccept() ΓòÉΓòÉΓòÉ
  356.  
  357. Select an item: 
  358.  
  359.  Syntax 
  360.  Parameters 
  361.  Return Values 
  362.  Definition 
  363.  Related Calls 
  364.  
  365.  
  366. ΓòÉΓòÉΓòÉ <hidden> Syntax for SockAccept() ΓòÉΓòÉΓòÉ
  367.  
  368. /* Implements the C function accept() */
  369.  
  370. socket = SockAccept(socket<,address>)
  371.  
  372.  
  373. ΓòÉΓòÉΓòÉ <hidden> Definition for SockAccept() ΓòÉΓòÉΓòÉ
  374.  
  375. The SockAccept() call implements the C function accept(). 
  376.  
  377.  
  378. ΓòÉΓòÉΓòÉ <hidden> Parameters for SockAccept() ΓòÉΓòÉΓòÉ
  379.  
  380.  socket 
  381.  
  382.  address (optional) 
  383.  
  384.  
  385. ΓòÉΓòÉΓòÉ <hidden> Return Values for SockAccept() ΓòÉΓòÉΓòÉ
  386.  
  387. Returns the same values as the C API call. 
  388.  
  389.  
  390. ΓòÉΓòÉΓòÉ 4.2. SockBind() ΓòÉΓòÉΓòÉ
  391.  
  392. Select an item: 
  393.  
  394.  Syntax 
  395.  Parameters 
  396.  Return Values 
  397.  Definition 
  398.  Related Calls 
  399.  
  400.  
  401. ΓòÉΓòÉΓòÉ <hidden> Syntax for SockBind() ΓòÉΓòÉΓòÉ
  402.  
  403. /* Implements the C function bind() */
  404.  
  405. rc = SockBind(socket,address)
  406.  
  407.  
  408. ΓòÉΓòÉΓòÉ <hidden> Definition for SockBind() ΓòÉΓòÉΓòÉ
  409.  
  410. The SockBind() call implements the C function bind(). 
  411.  
  412.  
  413. ΓòÉΓòÉΓòÉ <hidden> Parameters for SockBind() ΓòÉΓòÉΓòÉ
  414.  
  415.  socket 
  416.  
  417.  address 
  418.  
  419.  
  420. ΓòÉΓòÉΓòÉ <hidden> Return Values for SockBind() ΓòÉΓòÉΓòÉ
  421.  
  422. Returns the same values as the C API call. 
  423.  
  424.  
  425. ΓòÉΓòÉΓòÉ 4.3. SockClose() ΓòÉΓòÉΓòÉ
  426.  
  427. Select an item: 
  428.  
  429.  Syntax 
  430.  Parameters 
  431.  Return Values 
  432.  Definition 
  433.  Related Calls 
  434.  
  435.  
  436. ΓòÉΓòÉΓòÉ <hidden> Syntax for SockClose() ΓòÉΓòÉΓòÉ
  437.  
  438. /* Implements the TCP/IP C API function
  439.    soclose()                          */
  440.  
  441. rc = SockClose(socket)
  442.  
  443.  
  444. ΓòÉΓòÉΓòÉ <hidden> Definition for SockClose() ΓòÉΓòÉΓòÉ
  445.  
  446. The SockClose() call implements the TCP/IP C API function soclose(). 
  447.  
  448. The SockClose() call is exactly the same as the SockSoClose() call. 
  449.  
  450.  
  451. ΓòÉΓòÉΓòÉ <hidden> Parameters for SockClose() ΓòÉΓòÉΓòÉ
  452.  
  453.  socket 
  454.  
  455.  
  456. ΓòÉΓòÉΓòÉ <hidden> Return Values for SockClose() ΓòÉΓòÉΓòÉ
  457.  
  458. Returns the same values as the C API call. 
  459.  
  460.  
  461. ΓòÉΓòÉΓòÉ 4.4. SockConnect() ΓòÉΓòÉΓòÉ
  462.  
  463. Select an item: 
  464.  
  465.  Syntax 
  466.  Parameters 
  467.  Return Values 
  468.  Definition 
  469.  Related Calls 
  470.  
  471.  
  472. ΓòÉΓòÉΓòÉ <hidden> Syntax for SockConnect() ΓòÉΓòÉΓòÉ
  473.  
  474. /* Implements the C function
  475.    connect()                         */
  476.  
  477. rc = SockConnect(socket,address)
  478.  
  479.  
  480. ΓòÉΓòÉΓòÉ <hidden> Definition for SockConnect() ΓòÉΓòÉΓòÉ
  481.  
  482. The SockConnect() call implements the C function connect(). 
  483.  
  484.  
  485. ΓòÉΓòÉΓòÉ <hidden> Parameters for SockConnect() ΓòÉΓòÉΓòÉ
  486.  
  487.  socket 
  488.  
  489.  address 
  490.  
  491.  
  492. ΓòÉΓòÉΓòÉ <hidden> Return Values for SockConnect() ΓòÉΓòÉΓòÉ
  493.  
  494. Returns the same values as the C API call. 
  495.  
  496.  
  497. ΓòÉΓòÉΓòÉ 4.5. SockDropFuncs() ΓòÉΓòÉΓòÉ
  498.  
  499. Select an item: 
  500.  
  501.  Syntax 
  502.  Parameters 
  503.  Return Values 
  504.  Definition 
  505.  Related Calls 
  506.  
  507.  
  508. ΓòÉΓòÉΓòÉ <hidden> Syntax for SockDropFuncs() ΓòÉΓòÉΓòÉ
  509.  
  510. /* Drops all functions in the REXX
  511.    Socket Support package         */
  512.  
  513. rc = SockDropFuncs()
  514.  
  515.  
  516. ΓòÉΓòÉΓòÉ <hidden> Definition for SockDropFuncs() ΓòÉΓòÉΓòÉ
  517.  
  518. The SockDropFuncs() call drops all the functions in the REXX Socket Support 
  519. package. 
  520.  
  521. To unload the DLL, you should first call the SockDropFuncs() function, then 
  522. exit all CMD.EXE shells.  After exiting all the command shells, the DLL will be 
  523. dropped by OS/2 and can be deleted or replaced. 
  524.  
  525.  
  526. ΓòÉΓòÉΓòÉ <hidden> Parameters for SockDropFuncs() ΓòÉΓòÉΓòÉ
  527.  
  528. none 
  529.  
  530.  
  531. ΓòÉΓòÉΓòÉ <hidden> Return Values for SockDropFuncs() ΓòÉΓòÉΓòÉ
  532.  
  533. Returns the same values as the C API call. 
  534.  
  535.  
  536. ΓòÉΓòÉΓòÉ 4.6. SockGetHostByAddr() ΓòÉΓòÉΓòÉ
  537.  
  538. Select an item: 
  539.  
  540.  Syntax 
  541.  Parameters 
  542.  Return Values 
  543.  Definition 
  544.  Related Calls 
  545.  
  546.  
  547. ΓòÉΓòÉΓòÉ <hidden> Syntax for SockGetHostByAddr() ΓòÉΓòÉΓòÉ
  548.  
  549. /* Implements the C function
  550.    gethostbyaddr()                    */
  551.  
  552. rc = SockGetHostByAddr(dotAddress,host<,domain>)
  553.  
  554.  
  555. ΓòÉΓòÉΓòÉ <hidden> Definition for SockGetHostByAddr() ΓòÉΓòÉΓòÉ
  556.  
  557. The SockGetHostByAddr() call implements the C function gethostbyaddr(). 
  558.  
  559.  
  560. ΓòÉΓòÉΓòÉ <hidden> Parameters for SockGetHostByAddr() ΓòÉΓòÉΓòÉ
  561.  
  562.  dotAddress 
  563.  
  564.  host 
  565.  
  566.  domain (optional) 
  567.  
  568.  
  569. ΓòÉΓòÉΓòÉ <hidden> Return Values for SockGetHostByAddr() ΓòÉΓòÉΓòÉ
  570.  
  571. 1 when SockGetHostByAddr() is successful. 
  572.  
  573. 0 when SockGetHostByAddr() has an error. 
  574.  
  575.  
  576. ΓòÉΓòÉΓòÉ 4.7. SockGetHostByName() ΓòÉΓòÉΓòÉ
  577.  
  578. Select an item: 
  579.  
  580.  Syntax 
  581.  Parameters 
  582.  Return Values 
  583.  Definition 
  584.  Related Calls 
  585.  
  586.  
  587. ΓòÉΓòÉΓòÉ <hidden> Syntax for SockGetHostByName() ΓòÉΓòÉΓòÉ
  588.  
  589. /* Implements the C function
  590.    gethostbyname()                    */
  591.  
  592. rc = SockGetHostByName(nameAddress,host)
  593.  
  594.  
  595. ΓòÉΓòÉΓòÉ <hidden> Definition for SockGetHostByName() ΓòÉΓòÉΓòÉ
  596.  
  597. The SockGetHostByName() call implements the C function gethostbyname(). 
  598.  
  599. The nameAddress should be the textual name of a host.  For example: 
  600.  
  601. "chris.vnet.ibm.com"
  602.  
  603.  
  604. ΓòÉΓòÉΓòÉ <hidden> Parameters for SockGetHostByName() ΓòÉΓòÉΓòÉ
  605.  
  606.  nameAddress - the textual name of a host.  For example: 
  607.  
  608.     "chris.vnet.ibm.com"
  609.  
  610.  host 
  611.  
  612.  
  613. ΓòÉΓòÉΓòÉ <hidden> Return Values for SockGetHostByName() ΓòÉΓòÉΓòÉ
  614.  
  615. 1 when SockGetHostByName() is successful. 
  616.  
  617. 0 when SockGetHostByName() has an error. 
  618.  
  619.  
  620. ΓòÉΓòÉΓòÉ 4.8. SockGetHostId() ΓòÉΓòÉΓòÉ
  621.  
  622. Select an item: 
  623.  
  624.  Syntax 
  625.  Parameters 
  626.  Return Values 
  627.  Definition 
  628.  Related Calls 
  629.  
  630.  
  631. ΓòÉΓòÉΓòÉ <hidden> Syntax for SockGetHostId() ΓòÉΓòÉΓòÉ
  632.  
  633. /* Implements the C function
  634.    gethostid()                    */
  635.  
  636. dotAddress = SockGetHostId()
  637.  
  638.  
  639. ΓòÉΓòÉΓòÉ <hidden> Definition for SockGetHostId() ΓòÉΓòÉΓòÉ
  640.  
  641. The SockGetHostId() call implements the C function gethostid(). 
  642.  
  643.  
  644. ΓòÉΓòÉΓòÉ <hidden> Parameters for SockGetHostId() ΓòÉΓòÉΓòÉ
  645.  
  646. none 
  647.  
  648.  
  649. ΓòÉΓòÉΓòÉ <hidden> Return Values for SockGetHostId() ΓòÉΓòÉΓòÉ
  650.  
  651. Returns the same values as the C API call. 
  652.  
  653.  
  654. ΓòÉΓòÉΓòÉ 4.9. SockGetPeerName() ΓòÉΓòÉΓòÉ
  655.  
  656. Select an item: 
  657.  
  658.  Syntax 
  659.  Parameters 
  660.  Return Values 
  661.  Definition 
  662.  Related Calls 
  663.  
  664.  
  665. ΓòÉΓòÉΓòÉ <hidden> Syntax for SockGetPeerName() ΓòÉΓòÉΓòÉ
  666.  
  667. /* Implements the C function
  668.    getpeername()                         */
  669.  
  670. rc = SockGetPeerName(socket,address)
  671.  
  672.  
  673. ΓòÉΓòÉΓòÉ <hidden> Definition for SockGetPeerName() ΓòÉΓòÉΓòÉ
  674.  
  675. The SockGetPeerName() call implements the C function getpeername(). 
  676.  
  677.  
  678. ΓòÉΓòÉΓòÉ <hidden> Parameters for SockGetPeerName() ΓòÉΓòÉΓòÉ
  679.  
  680.  socket 
  681.  
  682.  address 
  683.  
  684.  
  685. ΓòÉΓòÉΓòÉ <hidden> Return Values for SockGetPeerName() ΓòÉΓòÉΓòÉ
  686.  
  687. Returns the same values as the C API call. 
  688.  
  689.  
  690. ΓòÉΓòÉΓòÉ 4.10. SockGetSockName() ΓòÉΓòÉΓòÉ
  691.  
  692. Select an item: 
  693.  
  694.  Syntax 
  695.  Parameters 
  696.  Return Values 
  697.  Definition 
  698.  Related Calls 
  699.  
  700.  
  701. ΓòÉΓòÉΓòÉ <hidden> Syntax for SockGetSockName() ΓòÉΓòÉΓòÉ
  702.  
  703. /* Implements the C function
  704.    getsockname()                         */
  705.  
  706. rc = SockGetSockName(socket,address)
  707.  
  708.  
  709. ΓòÉΓòÉΓòÉ <hidden> Definition for SockGetSockName() ΓòÉΓòÉΓòÉ
  710.  
  711. The SockGetSockName() call implements the C function getsockname(). 
  712.  
  713.  
  714. ΓòÉΓòÉΓòÉ <hidden> Parameters for SockGetSockName() ΓòÉΓòÉΓòÉ
  715.  
  716.  socket 
  717.  
  718.  address 
  719.  
  720.  
  721. ΓòÉΓòÉΓòÉ <hidden> Return Values for SockGetSockName() ΓòÉΓòÉΓòÉ
  722.  
  723. Returns the same values as the C API call. 
  724.  
  725.  
  726. ΓòÉΓòÉΓòÉ 4.11. SockGetSockOpt() ΓòÉΓòÉΓòÉ
  727.  
  728. Select an item: 
  729.  
  730.  Syntax 
  731.  Parameters 
  732.  Return Values 
  733.  Definition 
  734.  Related Calls 
  735.  
  736.  
  737. ΓòÉΓòÉΓòÉ <hidden> Syntax for SockGetSockOpt() ΓòÉΓòÉΓòÉ
  738.  
  739. /* Implements the C function
  740.    getsockopt()                       */
  741.  
  742. rc = SockGetSockOpt(socket,level,optVar,optVal)
  743.  
  744.  
  745. ΓòÉΓòÉΓòÉ <hidden> Definition for SockGetSockOpt() ΓòÉΓòÉΓòÉ
  746.  
  747. The SockGetSockOpt() call implements the C function getsockopt(). 
  748.  
  749.  
  750. ΓòÉΓòÉΓòÉ <hidden> Parameters for SockGetSockOpt() ΓòÉΓòÉΓòÉ
  751.  
  752.  socket 
  753.  
  754.  level - "SOL_SOCKET" is the only valid value. 
  755.  
  756.  optVar - contains one of the following values after the call is made: 
  757.  
  758.     "SO_BROADCAST"
  759.     "SO_DEBUG"
  760.     "SO_DONTROUTE"
  761.     "SO_ERROR"
  762.     "SO_KEEPALIVE"
  763.     "SO_LINGER"
  764.     "SO_OOBINLINE"
  765.     "SO_RCVBUF"
  766.     "SO_RCVLOWAT"
  767.     "SO_RCVTIMEO"
  768.     "SO_REUSEADDR"
  769.     "SO_SNDBUF"
  770.     "SO_SNDLOWAT"
  771.     "SO_SNDTIMEO"
  772.     "SO_TYPE"
  773.     "SO_USELOOPBACK"
  774.  
  775.  optVal - the value of the option.  Generally, the values for optVal are 
  776.   integers.  The exceptions are: 
  777.  
  778.    "SO_LINGER" 
  779.       expects two blank delimited integers.  The first is the l_onoff value and 
  780.       the second is the l_linger value. 
  781.  
  782.    "SO_TYPE" 
  783.       a string of either "STREAM", "DGRAM", or "RAW" 
  784.  
  785.  
  786. ΓòÉΓòÉΓòÉ <hidden> Return Values for SockGetSockOpt() ΓòÉΓòÉΓòÉ
  787.  
  788. Returns the same values as the C API call. 
  789.  
  790.  
  791. ΓòÉΓòÉΓòÉ 4.12. SockInit() ΓòÉΓòÉΓòÉ
  792.  
  793. Select an item: 
  794.  
  795.  Syntax 
  796.  Parameters 
  797.  Return Values 
  798.  Definition 
  799.  Related Calls 
  800.  
  801.  
  802. ΓòÉΓòÉΓòÉ <hidden> Syntax for SockInit() ΓòÉΓòÉΓòÉ
  803.  
  804. /* Implements the C function
  805.    sock_init()                       */
  806.  
  807. rc = SockInit()
  808.  
  809.  
  810. ΓòÉΓòÉΓòÉ <hidden> Definition for SockInit() ΓòÉΓòÉΓòÉ
  811.  
  812. The SockInit() call implements the C function sock_init(). 
  813.  
  814. For each REXX Socket Support (rxSock) function call, initialization is done if 
  815. initialization has not yet occurred.  Therefore, the SockInit() call is not 
  816. needed. 
  817.  
  818.  
  819. ΓòÉΓòÉΓòÉ <hidden> Parameters for SockInit() ΓòÉΓòÉΓòÉ
  820.  
  821. none 
  822.  
  823.  
  824. ΓòÉΓòÉΓòÉ <hidden> Return Values for SockInit() ΓòÉΓòÉΓòÉ
  825.  
  826. Returns the same values as the C API call. 
  827.  
  828.  
  829. ΓòÉΓòÉΓòÉ 4.13. SockIoctl() ΓòÉΓòÉΓòÉ
  830.  
  831. Select an item: 
  832.  
  833.  Syntax 
  834.  Parameters 
  835.  Return Values 
  836.  Definition 
  837.  Related Calls 
  838.  
  839.  
  840. ΓòÉΓòÉΓòÉ <hidden> Syntax for SockIoctl() ΓòÉΓòÉΓòÉ
  841.  
  842. /* Implements the C function ioctl() */
  843.  
  844. rc = SockIoctl(socket,ioctlCmd,ioctlData)
  845.  
  846.  
  847. ΓòÉΓòÉΓòÉ <hidden> Definition for SockIoclt() ΓòÉΓòÉΓòÉ
  848.  
  849. The SockIoclt() call implements the C function ioclt(). 
  850.  
  851.  
  852. ΓòÉΓòÉΓòÉ <hidden> Parameters for SockIoclt() ΓòÉΓòÉΓòÉ
  853.  
  854.  socket 
  855.  
  856.  ioctlCmd - the ioctl command to perform.  The valid commands are: 
  857.  
  858.     "FIONBIO"
  859.     "FIONREAD"
  860.  
  861.  ioctlData - the command specific value.  The valid values are: 
  862.  
  863.     "FIONBIO"  - "1" or "0"
  864.     "FIONREAD" - name  of a variable to
  865.                  contain the number of
  866.                  readable bytes
  867.  
  868.  
  869. ΓòÉΓòÉΓòÉ <hidden> Return Values for SockIoclt() ΓòÉΓòÉΓòÉ
  870.  
  871. Returns the same values as the C API call. 
  872.  
  873.  
  874. ΓòÉΓòÉΓòÉ 4.14. SockListen() ΓòÉΓòÉΓòÉ
  875.  
  876. Select an item: 
  877.  
  878.  Syntax 
  879.  Parameters 
  880.  Return Values 
  881.  Definition 
  882.  Related Calls 
  883.  
  884.  
  885. ΓòÉΓòÉΓòÉ <hidden> Syntax for SockListen() ΓòÉΓòÉΓòÉ
  886.  
  887. /* Implements the C function listen() */
  888.  
  889. rc = SockListen(socket,backlog)
  890.  
  891.  
  892. ΓòÉΓòÉΓòÉ <hidden> Definition for SockListen() ΓòÉΓòÉΓòÉ
  893.  
  894. The SockListen() call implements the C function listen(). 
  895.  
  896.  
  897. ΓòÉΓòÉΓòÉ <hidden> Parameters for SockListen() ΓòÉΓòÉΓòÉ
  898.  
  899.  socket 
  900.  
  901.  backlog - maximum length for the queue of pending connections. 
  902.  
  903.  
  904. ΓòÉΓòÉΓòÉ <hidden> Return Values for SockListen() ΓòÉΓòÉΓòÉ
  905.  
  906. Returns the same values as the C API call. 
  907.  
  908.  
  909. ΓòÉΓòÉΓòÉ 4.15. SockLoadFuncs() ΓòÉΓòÉΓòÉ
  910.  
  911. Select an item: 
  912.  
  913.  Syntax 
  914.  Parameters 
  915.  Return Values 
  916.  Definition 
  917.  Related Calls 
  918.  
  919.  
  920. ΓòÉΓòÉΓòÉ <hidden> Syntax for SockLoadFuncs() ΓòÉΓòÉΓòÉ
  921.  
  922. /* Loads all functions in the REXX
  923.    Socket Support package         */
  924.  
  925. rc = SockLoadFuncs()
  926.  
  927.  
  928. ΓòÉΓòÉΓòÉ <hidden> Definition for SockLoadFuncs() ΓòÉΓòÉΓòÉ
  929.  
  930. The SockLoadFuncs() call loads all the functions in the REXX Socket Support 
  931. package. 
  932.  
  933.  
  934. ΓòÉΓòÉΓòÉ <hidden> Parameters for SockLoadFuncs() ΓòÉΓòÉΓòÉ
  935.  
  936. SockLoadFuncs() - If any parameters are passed to this function, it will bypass 
  937. the copyright information that is normally displayed. 
  938.  
  939. All parameters are ignored (except to determine whether or not to bypass 
  940. displaying the information). 
  941.  
  942.  
  943. ΓòÉΓòÉΓòÉ <hidden> Return Values for ΓòÉΓòÉΓòÉ
  944.  
  945. SockLoadFuncs() 
  946.  
  947. Returns the same values as the C API call. 
  948.  
  949.  
  950. ΓòÉΓòÉΓòÉ 4.16. SockPSock_Errno() ΓòÉΓòÉΓòÉ
  951.  
  952. Select an item: 
  953.  
  954.  Syntax 
  955.  Parameters 
  956.  Return Values 
  957.  Definition 
  958.  Related Calls 
  959.  
  960.  
  961. ΓòÉΓòÉΓòÉ <hidden> Syntax for SockPSock_Errno() ΓòÉΓòÉΓòÉ
  962.  
  963. /* Implements the C function
  964.    psock_errno()                   */
  965.  
  966. SockPSock_Errno(<error_string>)
  967.  
  968.  
  969. ΓòÉΓòÉΓòÉ <hidden> Definition for SockPSock_Errno() ΓòÉΓòÉΓòÉ
  970.  
  971. The SockPSock_Errno() call implements the C function psock_errno(). 
  972.  
  973.  
  974. ΓòÉΓòÉΓòÉ <hidden> Parameters for SockPSock_Errno() ΓòÉΓòÉΓòÉ
  975.  
  976. error_string (optional) 
  977.    The error string that is written to the standard error device.  It describes 
  978.    the last error encountered. 
  979.  
  980.    The output to the standard error device has the following format: 
  981.  
  982.     the error string 
  983.     a colon 
  984.     a space 
  985.     the error message from sock_errno() 
  986.  
  987.  
  988. ΓòÉΓòÉΓòÉ <hidden> Return Values for SockPSock_Errno() ΓòÉΓòÉΓòÉ
  989.  
  990. Returns the same values as the C API call. 
  991.  
  992.  
  993. ΓòÉΓòÉΓòÉ 4.17. SockRecv() ΓòÉΓòÉΓòÉ
  994.  
  995. Select an item: 
  996.  
  997.  Syntax 
  998.  Parameters 
  999.  Return Values 
  1000.  Definition 
  1001.  Related Calls 
  1002.  
  1003.  
  1004. ΓòÉΓòÉΓòÉ <hidden> Syntax for SockRecv() ΓòÉΓòÉΓòÉ
  1005.  
  1006. /* Implements the C function recv() */
  1007.  
  1008. rc = SockRecv(socket,var,len<,flags>)
  1009.  
  1010.  
  1011. ΓòÉΓòÉΓòÉ <hidden> Definition for SockRecv() ΓòÉΓòÉΓòÉ
  1012.  
  1013. The SockRecv call implements the C function recv(). 
  1014.  
  1015.  
  1016. ΓòÉΓòÉΓòÉ <hidden> Parameters for SockRecv() ΓòÉΓòÉΓòÉ
  1017.  
  1018. socket 
  1019.  
  1020. var 
  1021.    name of a REXX variable that data should be received into. 
  1022.  
  1023. len 
  1024.    maximum amount of data to read. 
  1025.  
  1026. flags (optional) 
  1027.    a blank delimited list of options.  The options are: "MSG_OOB" and 
  1028.    "MSG_PEEK". 
  1029.  
  1030.  
  1031. ΓòÉΓòÉΓòÉ <hidden> Return Values for SockRecv() ΓòÉΓòÉΓòÉ
  1032.  
  1033. Returns the return code from the recv() function. 
  1034.  
  1035.  
  1036. ΓòÉΓòÉΓòÉ 4.18. SockRecvFrom() ΓòÉΓòÉΓòÉ
  1037.  
  1038. Select an item: 
  1039.  
  1040.  Syntax 
  1041.  Parameters 
  1042.  Return Values 
  1043.  Definition 
  1044.  Related Calls 
  1045.  
  1046.  
  1047. ΓòÉΓòÉΓòÉ <hidden> Syntax for SockRecvFrom() ΓòÉΓòÉΓòÉ
  1048.  
  1049. /* Implements the C function recvfrom() */
  1050.  
  1051. rc = SockRecvFrom(socket,var,len<,flags>,address)
  1052.  
  1053.  
  1054. ΓòÉΓòÉΓòÉ <hidden> Definition for SockRecvFrom() ΓòÉΓòÉΓòÉ
  1055.  
  1056. The SockRecvFrom call implements the C function recvfrom(). 
  1057.  
  1058.  
  1059. ΓòÉΓòÉΓòÉ <hidden> Parameters for SockRecvFrom() ΓòÉΓòÉΓòÉ
  1060.  
  1061. socket 
  1062.  
  1063. var 
  1064.    name of a REXX variable that data should be received into. 
  1065.  
  1066. len 
  1067.    maximum amount of data to read. 
  1068.  
  1069. flags (optional) 
  1070.    a blank delimited list of options.  The options are: "MSG_OOB" and 
  1071.    "MSG_PEEK". 
  1072.  
  1073. address 
  1074.  
  1075.  
  1076. ΓòÉΓòÉΓòÉ <hidden> Return Values for SockRecvFrom() ΓòÉΓòÉΓòÉ
  1077.  
  1078. Returns the return code from the recvfrom() C function. 
  1079.  
  1080.  
  1081. ΓòÉΓòÉΓòÉ 4.19. SockSelect() ΓòÉΓòÉΓòÉ
  1082.  
  1083. Select an item: 
  1084.  
  1085.  Syntax 
  1086.  Parameters 
  1087.  Return Values 
  1088.  Definition 
  1089.  Related Calls 
  1090.  
  1091.  
  1092. ΓòÉΓòÉΓòÉ <hidden> Syntax for SockSelect() ΓòÉΓòÉΓòÉ
  1093.  
  1094. /* Implements the C function select() */
  1095.  
  1096. rc = SockSelect(reads,writes,excepts<,timeout>)
  1097.  
  1098.  
  1099. ΓòÉΓòÉΓòÉ <hidden> Definition for SockSelect() ΓòÉΓòÉΓòÉ
  1100.  
  1101. The SockSelect call implements the C function select(). 
  1102.  
  1103.  
  1104. ΓòÉΓòÉΓòÉ <hidden> Parameters for SockSelect() ΓòÉΓòÉΓòÉ
  1105.  
  1106. reads,writes,excepts 
  1107.  
  1108. The reads, writes, and excepts parameters are stem variables which are queried 
  1109. and set by this function.  The stem.0 variable should contain the number of 
  1110. sockets, stem.1 the first socket, etc.  Upon return, the stem variables will be 
  1111. reset to the sockets which are ready.  For example: 
  1112.  
  1113. r.0 = 2
  1114. r.1 = 101
  1115. r.2 = 102
  1116. w.0 = 1
  1117. w.1 = 103
  1118. e.0 = 0
  1119.  
  1120. rc = SockSelect("r.","w.","e.")
  1121.  
  1122. do i = 1 to r.0
  1123.    say "socket" r.i "is ready for reading."
  1124. end
  1125.  
  1126. If any of the stem variables are "", no parameter is passed and no sockets for 
  1127. that type will be checked.  For example, the SockSelect() call above could have 
  1128. been invoked as either: 
  1129.  
  1130. rc = SockSelect("r.","w.","")
  1131. rc = SockSelect("r.","w.",)
  1132.  
  1133. timeout 
  1134.  
  1135. The timeout parameter is the number of seconds to wait before timing out.  The 
  1136. number must be integer.  For no waiting, use a value of 0. To wait 
  1137. indefinitely, use "". 
  1138.  
  1139. If no timeout value is passed, "" is assumed.  Non-numeric and negative numbers 
  1140. are considered 0. 
  1141.  
  1142. The function call SockSelect(,,,3) results in the program pausing for 3 
  1143. seconds. 
  1144.  
  1145. Related Topic 
  1146.  
  1147. Notes on stemmed variables
  1148.  
  1149.  
  1150. ΓòÉΓòÉΓòÉ <hidden> Return Values for SockSelect() ΓòÉΓòÉΓòÉ
  1151.  
  1152. The return value from SockSelect() is the number of ready sockets. 
  1153.  
  1154. If a timeout occurred, a value of 0 is returned and the socket arrays are not 
  1155. modified. 
  1156.  
  1157.  
  1158. ΓòÉΓòÉΓòÉ 4.20. SockSend() ΓòÉΓòÉΓòÉ
  1159.  
  1160. Select an item: 
  1161.  
  1162.  Syntax 
  1163.  Parameters 
  1164.  Return Values 
  1165.  Definition 
  1166.  Related Calls 
  1167.  
  1168.  
  1169. ΓòÉΓòÉΓòÉ <hidden> Syntax for SockSend() ΓòÉΓòÉΓòÉ
  1170.  
  1171. /* Implements the C function send() */
  1172.  
  1173. rc = SockSend(socket,data<,flags>)
  1174.  
  1175.  
  1176. ΓòÉΓòÉΓòÉ <hidden> Definition for SockSend() ΓòÉΓòÉΓòÉ
  1177.  
  1178. The SockSend call implements the C function send(). 
  1179.  
  1180.  
  1181. ΓòÉΓòÉΓòÉ <hidden> Parameters for SockSend() ΓòÉΓòÉΓòÉ
  1182.  
  1183. socket 
  1184.  
  1185. data 
  1186.    a string of text to be sent on the sock. 
  1187.  
  1188. flags (optional) 
  1189.    a blank delimited list of options.  The options are: "MSG_OOB" and 
  1190.    "MSG_DONTROUTE". 
  1191.  
  1192.  
  1193. ΓòÉΓòÉΓòÉ <hidden> Return Values for SockSend() ΓòÉΓòÉΓòÉ
  1194.  
  1195. Returns the return code from the send() C function. 
  1196.  
  1197.  
  1198. ΓòÉΓòÉΓòÉ 4.21. SockSendTo() ΓòÉΓòÉΓòÉ
  1199.  
  1200. Select an item: 
  1201.  
  1202.  Syntax 
  1203.  Parameters 
  1204.  Return Values 
  1205.  Definition 
  1206.  Related Calls 
  1207.  
  1208.  
  1209. ΓòÉΓòÉΓòÉ <hidden> Syntax for SockSendTo() ΓòÉΓòÉΓòÉ
  1210.  
  1211. /* Implements the C function sendto() */
  1212.  
  1213. rc = SockSendTo(socket,data<,flags>,address)
  1214.  
  1215.  
  1216. ΓòÉΓòÉΓòÉ <hidden> Definition for SockSendTo() ΓòÉΓòÉΓòÉ
  1217.  
  1218. The SockSendTo() call implements the C function sendto(). 
  1219.  
  1220.  
  1221. ΓòÉΓòÉΓòÉ <hidden> Parameters for SockSendTo() ΓòÉΓòÉΓòÉ
  1222.  
  1223. socket 
  1224.  
  1225. data 
  1226.    a string of text to be sent on the sock. 
  1227.  
  1228. flags (optional) 
  1229.    the only option is "MSG_DONTROUTE". 
  1230.  
  1231. address 
  1232.  
  1233.  
  1234. ΓòÉΓòÉΓòÉ <hidden> Return Values for SockSendTo() ΓòÉΓòÉΓòÉ
  1235.  
  1236. Returns the return code from the sendto() C function. 
  1237.  
  1238.  
  1239. ΓòÉΓòÉΓòÉ 4.22. SockSetSockOpt() ΓòÉΓòÉΓòÉ
  1240.  
  1241. Select an item: 
  1242.  
  1243.  Syntax 
  1244.  Parameters 
  1245.  Return Values 
  1246.  Definition 
  1247.  Related Calls 
  1248.  
  1249.  
  1250. ΓòÉΓòÉΓòÉ <hidden> Syntax for SockSetSockOpt() ΓòÉΓòÉΓòÉ
  1251.  
  1252. /* Implements the C function
  1253.    setsockopt()                     */
  1254.  
  1255. rc = SockSetSockOpt(socket,level,optVar,optVal)
  1256.  
  1257.  
  1258. ΓòÉΓòÉΓòÉ <hidden> Definition for SockSetSockOpt() ΓòÉΓòÉΓòÉ
  1259.  
  1260. The SockSetSockOpt() call implements the C function setsockopt(). 
  1261.  
  1262.  
  1263. ΓòÉΓòÉΓòÉ <hidden> Parameters for SockSetSockOpt() ΓòÉΓòÉΓòÉ
  1264.  
  1265.  socket 
  1266.  
  1267.  level - "SOL_SOCKET" is the only valid value. 
  1268.  
  1269.  optVar - the values are: 
  1270.  
  1271.     "SO_BROADCAST"
  1272.     "SO_DEBUG"
  1273.     "SO_DONTROUTE"
  1274.     "SO_KEEPALIVE"
  1275.     "SO_LINGER"
  1276.     "SO_OOBINLINE"
  1277.     "SO_RCVBUF"
  1278.     "SO_RCVLOWAT"
  1279.     "SO_RCVTIMEO"
  1280.     "SO_REUSEADDR"
  1281.     "SO_SNDBUF"
  1282.     "SO_SNDLOWAT"
  1283.     "SO_SNDTIMEO"
  1284.     "SO_USELOOPBACK"
  1285.  
  1286.  optVal - the value of the option.  Generally, the values for optVal are 
  1287.   integers.  The exceptions are: 
  1288.  
  1289.    "SO_LINGER" 
  1290.       expects two blank delimited integers.  The first is the l_onoff value and 
  1291.       the second is the l_linger value. 
  1292.  
  1293.    "SO_TYPE" 
  1294.       a string of either "STREAM", "DGRAM", or "RAW" 
  1295.  
  1296.  
  1297. ΓòÉΓòÉΓòÉ <hidden> Return Values for SockSetSockOpt() ΓòÉΓòÉΓòÉ
  1298.  
  1299. Returns the same values as the C API call. 
  1300.  
  1301.  
  1302. ΓòÉΓòÉΓòÉ 4.23. SockShutDown() ΓòÉΓòÉΓòÉ
  1303.  
  1304. Select an item: 
  1305.  
  1306.  Syntax 
  1307.  Parameters 
  1308.  Return Values 
  1309.  Definition 
  1310.  Related Calls 
  1311.  
  1312.  
  1313. ΓòÉΓòÉΓòÉ <hidden> Syntax for SockShutDown() ΓòÉΓòÉΓòÉ
  1314.  
  1315. /* Implements the C function
  1316.    shutdown()                         */
  1317.  
  1318. rc = SockShutDown(socket,how)
  1319.  
  1320.  
  1321. ΓòÉΓòÉΓòÉ <hidden> Definition for SockShutDown() ΓòÉΓòÉΓòÉ
  1322.  
  1323. The SockShutDown() call implements the C function shutdown(). 
  1324.  
  1325.  
  1326. ΓòÉΓòÉΓòÉ <hidden> Parameters for SockShutDown() ΓòÉΓòÉΓòÉ
  1327.  
  1328.  socket 
  1329.  
  1330.  how - identifies the condition of the shutdown.  The values are: 
  1331.  
  1332.    0    ends communication from the socket. 
  1333.  
  1334.    1    ends communication to the socket. 
  1335.  
  1336.    2    ends communication both from and to the socket. 
  1337.  
  1338.  
  1339. ΓòÉΓòÉΓòÉ <hidden> Return Values for SockShutDown() ΓòÉΓòÉΓòÉ
  1340.  
  1341. Returns the same values as the C API call. 
  1342.  
  1343.  
  1344. ΓòÉΓòÉΓòÉ 4.24. SockSock_Errno() ΓòÉΓòÉΓòÉ
  1345.  
  1346. Select an item: 
  1347.  
  1348.  Syntax 
  1349.  Parameters 
  1350.  Return Values 
  1351.  Definition 
  1352.  Related Calls 
  1353.  
  1354.  
  1355. ΓòÉΓòÉΓòÉ <hidden> Syntax for SockSock_Errno() ΓòÉΓòÉΓòÉ
  1356.  
  1357. /* Implements the C function
  1358.    sock_errno()                       */
  1359.  
  1360. errno = SockSock_Errno()
  1361.  
  1362.  
  1363. ΓòÉΓòÉΓòÉ <hidden> Definition for SockSock_Errno() ΓòÉΓòÉΓòÉ
  1364.  
  1365. The SockSock_Errno() call implements the C function sock_errno(). 
  1366.  
  1367.  
  1368. ΓòÉΓòÉΓòÉ <hidden> Parameters for SockSock_Errno() ΓòÉΓòÉΓòÉ
  1369.  
  1370. none 
  1371.  
  1372.  
  1373. ΓòÉΓòÉΓòÉ <hidden> Return Values for SockSock_Errno() ΓòÉΓòÉΓòÉ
  1374.  
  1375. errno 
  1376.    the numerical error value of last error that occurred. 
  1377.  
  1378.  
  1379. ΓòÉΓòÉΓòÉ 4.25. SockSocket() ΓòÉΓòÉΓòÉ
  1380.  
  1381. Select an item: 
  1382.  
  1383.  Syntax 
  1384.  Parameters 
  1385.  Return Values 
  1386.  Definition 
  1387.  Related Calls 
  1388.  
  1389.  
  1390. ΓòÉΓòÉΓòÉ <hidden> Syntax for SockSocket() ΓòÉΓòÉΓòÉ
  1391.  
  1392. /* Implements the C function socket() */
  1393.  
  1394. socket = SockSocket(domain,type,protocol)
  1395.  
  1396.  
  1397. ΓòÉΓòÉΓòÉ <hidden> Definition for SockSocket() ΓòÉΓòÉΓòÉ
  1398.  
  1399. The SockSocket() call implements the C function socket(). 
  1400.  
  1401.  
  1402. ΓòÉΓòÉΓòÉ <hidden> Parameters for SockSocket() ΓòÉΓòÉΓòÉ
  1403.  
  1404. domain 
  1405.  
  1406. type 
  1407.    may be "SOCK_STREAM", "SOCK_DGRAM", or "SOCK_RAW". 
  1408.  
  1409. protocol 
  1410.    may be "IPPROTO_UDP", "IPPROTO_TCP", or "0". 
  1411.  
  1412.  
  1413. ΓòÉΓòÉΓòÉ <hidden> Return Values for SockSocket() ΓòÉΓòÉΓòÉ
  1414.  
  1415. Returns the same values as the C API call. 
  1416.  
  1417.  
  1418. ΓòÉΓòÉΓòÉ 4.26. SockSoClose() ΓòÉΓòÉΓòÉ
  1419.  
  1420. Select an item: 
  1421.  
  1422.  Syntax 
  1423.  Parameters 
  1424.  Return Values 
  1425.  Definition 
  1426.  Related Calls 
  1427.  
  1428.  
  1429. ΓòÉΓòÉΓòÉ <hidden> Syntax for SockSoClose() ΓòÉΓòÉΓòÉ
  1430.  
  1431. /* Implements the C function soclose() */
  1432.  
  1433. rc = SockSoClose(socket)
  1434.  
  1435.  
  1436. ΓòÉΓòÉΓòÉ <hidden> Definition for SockSoClose() ΓòÉΓòÉΓòÉ
  1437.  
  1438. The SockSoClose() call implements the C function soclose(). 
  1439.  
  1440. The SockSoClose() call is exactly the same as the SockClose() call. 
  1441.  
  1442.  
  1443. ΓòÉΓòÉΓòÉ <hidden> Parameters for SockSoClose() ΓòÉΓòÉΓòÉ
  1444.  
  1445.  socket 
  1446.  
  1447.  
  1448. ΓòÉΓòÉΓòÉ <hidden> Return Values for SockSoClose() ΓòÉΓòÉΓòÉ
  1449.  
  1450. Returns the same values as the C API call. 
  1451.  
  1452.  
  1453. ΓòÉΓòÉΓòÉ 4.27. SockVersion() ΓòÉΓòÉΓòÉ
  1454.  
  1455. Select an item: 
  1456.  
  1457.  Syntax 
  1458.  Parameters 
  1459.  Return Values 
  1460.  Definition 
  1461.  Related Calls 
  1462.  
  1463.  
  1464. ΓòÉΓòÉΓòÉ <hidden> Syntax for SockVersion() ΓòÉΓòÉΓòÉ
  1465.  
  1466. /* Identifies the version of the REXX
  1467.    Socket Support package            */
  1468.  
  1469. vers = SockVersion()
  1470.  
  1471.  
  1472. ΓòÉΓòÉΓòÉ <hidden> Definition for SockVersion() ΓòÉΓòÉΓòÉ
  1473.  
  1474. The SockVersion() call identifies the version of the REXX Socket Support 
  1475. package.  The current version is 2.0. 
  1476.  
  1477.  
  1478. ΓòÉΓòÉΓòÉ <hidden> Parameters for SockVersion() ΓòÉΓòÉΓòÉ
  1479.  
  1480. none 
  1481.  
  1482.  
  1483. ΓòÉΓòÉΓòÉ <hidden> Return Values for SockVersion() ΓòÉΓòÉΓòÉ
  1484.  
  1485. Returns the REXX Socket Support package version number.